﻿Imports System.Object
Imports VSModel
Imports Cls_Common
Imports System.IO
Partial Class FrontEnd_Control_Users_BaoTinSai
    Inherits System.Web.UI.UserControl

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If Not IsPostBack Then
            If Not Page.RouteData.Values("Id") Is Nothing Then
                hidRaoVatId.Value = Page.RouteData.Values("Id")
            End If
        End If
    End Sub

    Protected Sub btnSend_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSend.Click
        Using Data As New VSEntities
            Dim p As New VSModel.BaoTinSai
            Try
                p.NoiDung = txtNoidung.Text.Trim
                p.RaoVatId = hidRaoVatId.Value
                p.Created = Now
                p.UserId = Session("UserID")
                Data.BaoTinSais.AddObject(p)
                Data.SaveChanges()
                Excute_Javascript("init();", Me.Page, True)

            Catch ex As Exception

            End Try
        End Using
    End Sub
End Class
